package com.attilax.facedetection;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

public class Logger {

	private String pre;
	private String dir;

	public Logger(String dir, String pre) {
	this.dir=dir;this.pre=pre;
	}

	public void info(String picjson) {
		System.out.println(picjson);
	      try {
			FileUtils.writeStringToFile( new File(dir+"/"+pre+"log.txt"), picjson+"\r\n", true);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	public void error(String jsonString) {
	info(jsonString);
		
	}

}
